package com.jackeysun.log

import android.app.Activity
import android.os.Bundle
import com.jackeysun.log.databinding.ActivityLogBinding

class LogActivity : Activity() {

    private lateinit var mBinding: ActivityLogBinding
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mBinding = ActivityLogBinding.inflate(layoutInflater)
        setContentView(mBinding.root)
//        lifecycleScope.launch {
//            delay(1000)
            readLog()
//        }
    }

    private fun readLog(){
        val files = LogConfig.file?.getLogFileList()
        if (files.isNullOrEmpty()) return
        mBinding.consoleView.setFile(files[0])
    }
}